const AuthService = require('../services/auth.service')
const authService = new AuthService()
class AuthController {
  async signUp (ctx, next) {
    const userData = ctx.request.body
    const user = await authService.signUp(userData)
    ctx.response.body = user
  }
  async signIn (ctx, next) {
    const userData = ctx.request.body
    const user = await authService.signIn(userData)
    ctx.response.body = user
    next()
  }
  async signOut (ctx, next) {
    const userData = ctx.request.body
    const user = await authService.signOut(userData)
    ctx.response = user
  }
}

module.exports = AuthController